@layout("/common/_container.html"){
<link href="https://pynnn.oss-cn-hangzhou.aliyuncs.com/market.css?v=20200628" rel="stylesheet">
<div class="ibox float-e-margins " style="height: 100%">
    <div class="ibox-content" style="height: 100%;padding: 0;">
        <div style="display: none">
            <input type="hidden" id="id" value="${reservationsInfo.id}">
            <input id="economicAbilityValue" type="hidden" value="${reservationsInfo.economicAbility}"/>
            <input id="occupationValue" type="hidden" value="${reservationsInfo.occupation}"/>
            <input type="hidden" id="customerSexValue" value="${reservationsInfo.customerSex}">
            <input type="hidden" id="charactersValue" value="${reservationsInfo.characters}">
            <input type="hidden" id="consumptionHabitsValue" value="${reservationsInfo.consumptionHabits}">
            <input type="hidden" id="isLargeValue" value="${reservationsInfo.isLarge}">
            <input type="hidden" id="oneMediumValue" value="${reservationsInfo.oneMedium}">
            <input type="hidden" id="twoMediumValue" value="${reservationsInfo.twoMedium}">
            <input type="hidden" id="thrMediumValue" value="${reservationsInfo.thrMedium}">
            <input type="hidden" id="oneChannelValue" value="${reservationsInfo.oneChannel}">
            <input type="hidden" id="twoChannelValue" value="${reservationsInfo.twoChannel}">
            <input type="hidden" id="thrChannelValue" value="${reservationsInfo.thrChannel}">
            <input type="hidden" id="outpatientNameValue" value="${reservationsInfo.outpatientName}">
            <input type="hidden" id="statusValue" value="${reservationsInfo.status}">
            <input type="hidden" id="statussValue" value="${reservationsInfo.statuss}">
            <input type="hidden" id="payservicenameValue" value="${reservationsInfo.appointmentPayService}">
            <input type="hidden" id="phoneSharShipValue" value="${reservationsInfo.phoneSharShip}">
            <input type="hidden" id="accessDiseaseValue" value="${reservationsInfo.accessDisease}">
            <input type="hidden" id="maritalStatus" value="${reservationsInfo.maritalStatus}">
            <input type="hidden" id="huifang" value="${reservationsInfo.huifang}">
            <input type="hidden" id="reservationsId" value="${reservationsInfo.id}">
            <input type="hidden" id="userName" value="${userName}">
            <input type="hidden" id="roleName" value="${roleName}">
            <input type="hidden" id="isEffective" value="">
            <input type="hidden" id="sortMap" value="">
        </div>
        <div class="marketHeader">
            <span style="font-size: 1.5em;font-weight: bolder;">${reservationsInfo.customerName}</span>
            <span>${reservationsInfo.customerAge}岁</span>
            <span><select id="select1" name="customerSex" style="height: 35px;" disabled="disabled">
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select></span>
            <span>电话：${reservationsInfo.customerPhone}</span>
            <span>病历号：${reservationsInfo.identificationNumber}</span>
            <span><button class="btn returnBtn" type="button" onclick="ReservationsInfoDlg.close()">返回上一级</button></span>
        </div>
        <div class="marketContent">
            <div class="nav_table" id="reservationsInfoForm">
                <ul class="nav nav-tabs nav_ul" role="tablist" id="navBox">
                    <li role="presentation" class="active onRecord"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">患者信息</a></li>
                    <li role="presentation"><a href="#customer" aria-controls="customer" role="tab" data-toggle="tab">到店患者信息</a></li>
                    <li role="presentation"><a href="#doctor" aria-controls="doctor" role="tab" data-toggle="tab">看诊记录</a></li>
                    <li role="presentation"><a href="#visit" aria-controls="visit" role="tab" data-toggle="tab">就诊记录</a></li>
                    <li role="presentation"><a href="#deal" aria-controls="deal" role="tab" data-toggle="tab">收费记录</a></li>
                    <li role="presentation"><a href="#returnVisit" aria-controls="returnVisit" role="tab" data-toggle="tab">回访记录</a></li>
                    <li role="presentation"><a role="tab" data-toggle="tab" href="#settings" aria-controls="settings">TC回访记录</a></li>
                </ul>
                <div class="tab-content content_box" id="contentBox">
                    <div role="tabpanel" class="tab-pane active onRecord" id="home">
                        <div class="home_box">
                            <div style="border-bottom: 1px solid #cccccc"><h4>个人信息</h4></div>
                            <div class="newBox">
                                <div>
                                    <div>
                                        <span>预约号：</span>
                                        <input type="text" class="modify partInput" id="reservationsNum" value="${reservationsInfo.reservationsNum}">
                                    </div>
                                    <div>
                                        <span>姓名：</span>
                                        <input type="text" class="modify partInput" id="customerName" value="${reservationsInfo.customerName}">
                                    </div>
                                    <div>
                                        <span>年龄：</span>
                                        <input type="text" class="modify partInput" id="customerAge" maxlength="3" oninput="value=value.replace(/[^\d]/g,'')" value="${reservationsInfo.customerAge}">
                                    </div>
                                    <div>
                                        <span>电话：</span>
                                        <input type="text" class="modify" id="customerPhone" value="${reservationsInfo.customerPhone}">
                                    </div>
                                    <div>
                                        <span>电话使用人：</span>
                                        <select class="select_styles" name="phoneSharShip" id="phoneSharShip">
                                            <option value="">请选择</option>
                                            @for(str in refereeShipList){
                                            <option value="${str.refereeShip}">${str.refereeShip}</option>
                                            @}
                                        </select>
                                    </div>
                                </div>
                                <div>
                                    <div>
                                        <span>性别：</span>
                                        <select class="select_styles partSelect" name="customerSex" id="customerSex">
                                            <option value="1">男</option>
                                            <option value="2">女</option>
                                        </select>
                                    </div>
                                    <div>
                                        <span>QQ号：</span>
                                        <input type="text" class="modify partInput" id="qqNumber" oninput="value=value.replace(/[^\d]/g,'')" value="${reservationsInfo.qqNumber}">
                                    </div>
                                    <div>
                                        <span>微信号：</span>
                                        <input type="text" class="modify partInput" id="wechatNumber" value="${reservationsInfo.wechatNumber}">
                                    </div>
                                    <div id="phone2" style="display: none">
                                        <span>电话2：</span>
                                        <input type="text" class="modify partInput" id="customerPhone2" value="${reservationsInfo.customerPhone2}" oninput="value=value.replace(/[^\d]/g,'')">
                                    </div>
                                    <div>
                                        <span>关键词：</span>
                                        <input type="text" class="modify partInput" id="keyWord" value="${reservationsInfo.keyWord}">
                                    </div>
                                </div>
                                <div></div>
                            </div>
                            <div style="border-bottom: 1px solid #cccccc;margin-top: 10px;"><h4>项目信息</h4></div>
                            <div class="newBox">
                                <div>
                                    <div>
                                        <span>访问病种：</span>
                                        <select class="select_styles" name="accessDisease" id="accessDisease">
                                            <option value="">请选择</option>
                                            <option value="种植">种植</option>
                                            <option value="正畸">正畸</option>
                                            <option value="修复">修复</option>
                                            <option value="美白">美白</option>
                                            <option value="牙周">牙周</option>
                                            <option value="医院类">医院类</option>
                                            <option value="拔牙智齿">拔牙智齿</option>
                                            <option value="洗牙洁牙">洗牙洁牙</option>
                                            <option value="儿童齿科">儿童齿科</option>
                                        </select>
                                    </div>
                                    <div>
                                        <span>预约门诊：</span>
                                        <select class="select_styles partSelect" name="outpatientName" id="outpatientName">
                                            <option value="">请选择</option>
                                            @for(str in outpatientManagementList){
                                            <option value="${str.simplename}">${str.simplename}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>是否大单：</span>
                                        <select class="select_styles partSelect" name="isLarge" id="isLarge">
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </div>
                                    <div>
                                        <span>性格：</span>
                                        <select class="select_styles partSelect directorSelect" name="characters" id="characters">
                                            <option value="">请选择</option>
                                            @for(str in charactersList){
                                            <option value="${str.characters}">${str.characters}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>一级渠道：</span>
                                        <select class="select_styles" name="oneChannel" id="oneChannel" ></select>
                                    </div>
                                    <div>
                                        <span>一级媒介：</span>
                                        <select class="select_styles" name="oneMedium" id="oneMedium"></select>
                                    </div>
                                </div>
                                <div>
                                    <div>
                                        <span>预约项目：</span>
                                        <select class="select_styles" name="appointmentPayService" id="appointmentPayService">
                                            <option value="">请选择</option>
                                            @for(str in departmentList){
                                            <option value="${str.department}">${str.department}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>建档人：</span>
                                        <input type="text" class="modify" readonly="readonly" id="archiving" value="${reservationsInfo.archiving}">
                                    </div>
                                    <div>
                                        <span>经济能力：</span>
                                        <select class="select_styles partSelect" name="economicAbility" id="economicAbility">
                                            <option value="">请选择</option>
                                            @for(str in economicAbilityList){
                                            <option value="${str.economicAbility}">${str.economicAbility}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>职业：</span>
                                        <select class="select_styles partSelect directorSelect" name="occupation" id="occupation">
                                            <option value="">请选择</option>
                                            @for(str in occupationList){
                                            <option value="${str.occupation}">${str.occupation}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>二级渠道：</span>
                                        <select class="select_styles" name="twoChannel" id="twoChannel"></select>
                                    </div>
                                    <div>
                                        <span>二级媒介：</span>
                                        <select class="select_styles" name="twoMedium" id="twoMedium"></select>
                                    </div>
                                </div>
                                <div>
                                    <div>
                                        <span>预约时间：</span>
                                        <input type="text" class="modify partInput" style="pointer-events: none" id="appointmentTimes" value="${reservationsInfo.appointmentTime}" onfocus="laydate({istiem:true,format:'YYYY-MM-DD hh:mm:ss'})">
                                    </div>
                                    <div>
                                        <span>跟进人：</span>
                                        <input type="text" class="modify" readonly="readonly" style="width: 60%;height: 26px;border-radius: 3px;border: none;" id="follower" value="${reservationsInfo.follower}">
                                    </div>
                                    <div>
                                        <span>建档时间：</span>
                                        <input type="text" class="modify" id="filingTime" value="${reservationsInfo.filingTime}">
                                    </div>
                                    <div>
                                        <span>消费习惯：</span>
                                        <select class="select_styles partSelect directorSelect" name="consumptionHabits" id="consumptionHabits">
                                            <option value="">请选择</option>
                                            @for(str in consumptionHabitsList){
                                            <option value="${str.consumptionHabits}">${str.consumptionHabits}</option>
                                            @}
                                        </select>
                                    </div>
                                    <div>
                                        <span>三级渠道：</span>
                                        <select class="select_styles" name="thrChannel" id="thrChannel"></select>
                                    </div>
                                    <div>
                                        <span>三级媒介：</span>
                                        <select class="select_styles" name="thrMedium" id="thrMedium"></select>
                                    </div>
                                </div>
                                <div>
                                    <div>
                                        <span>部门：</span>
                                        <input type="text" class="modify" id="department" value="${roleName}">
                                    </div>
                                    <div>
                                        @if(shiro.hasPermission("/reservations/updateBelonger")){
                                        <span>归属人：</span>
                                        <input type="text" class="modify" name="belonger" id="belonger1" readonly="readonly" value="${reservationsInfo.belonger}">
                                        @}
                                        @if(shiro.hasPermission("/reservations/notupdateBelonger")){
                                        <span>归属人：</span>
                                        <input type="text" class="modify" id="belonger2" name="belonger" readonly="readonly" style="border: none"
                                               value="${reservationsInfo.belonger}">
                                        @}
                                    </div>
                                    <div>
                                        <span>障碍点：</span>
                                        <input type="text" class="modify partInput" id="obstaclePoint" value="${reservationsInfo.obstaclePoint}">
                                    </div>
                                </div>
                            </div>
                            <div>
                                <p>客户详情</p>
                                <textarea id="remarks" name="remarks" readOnly="readOnly" rows="4" style="width: 75%;padding-left: 5px;">${reservationsInfo.remarks}</textarea>
                            </div>
                            <div>
                                <p>聊天记录</p>
                                <textarea id="content" name="content" readOnly="readOnly" rows="4" style="width: 75%;padding-left: 5px;">${reservationsInfo.content}</textarea>
                            </div>
                            <div>
                                <div class="btnBox">
                                    <button type="button" class="btn" onclick="ReservationsInfoDlg.editSubmit()">保存</button>
                                    <button type="button" class="btn" onclick="ReservationsInfoDlg.getEdit()">编辑</button>
                                    <button type="button" class="btn" onclick="ReservationsInfoDlg.getEditto()">取消编辑</button>
                                    <button type="button" class="btn" onclick="ReservationsInfoDlg.modifyChannel()">发起渠道修改</button>
                                    <button type="button" class="btn" onclick="ReservationsInfoDlg.close()">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane arrived" id="customer">
                        @layout("/marketing/reservations/customer_info.html"){
                        @}
                    </div>
                    <div role="tabpanel" class="tab-pane arrived" id="doctor">
                        <div class="home_box" style="padding: 10px 10px 0;">
                            <div id="consultantInfoTitle"></div>
                            <div style="height: 100%;background: white;padding: 12px 20px;">
                                <#sortDiagnosisDetail  id="sortDiagnosisDetail" list="${consultantInfoList}"/>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="visit">
                        <div class="home_box" style="padding: 10px 10px 0;">
                            <div style="height: 100%;background: white;padding: 12px 20px;">
                                <#sortVisitDetail id="sortVisitDetail" list="${customerInfoList}"/>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane arrived" id="deal">
                        @layout("/marketing/reservations/reservations_chargeDetails.html"){
                        @}
                    </div>
                    <div role="tabpanel" class="tab-pane notReached" id="returnVisit">
                        <div class="home_box">
                            <div class="returnVisit">
                                <div>
                                    <div><img src="https://pynnn.oss-cn-hangzhou.aliyuncs.com/export.png" style="width: 23px;vertical-align: bottom;"><h4>回访记录</h4></div>
                                    <div style="color: #2c9ae9;position: absolute;right: 15px;top: 7px;" class="showBox">添加</div>
                                    <div id="further"></div>
                                </div>
                                <div id="isRevisitInfoForm">
                                    <div class="hideBox" style="display: none">
                                        <div>请添加此次回访结果</div>
                                        <div><textarea id="revisitContent" name="revisitContent" rows="6" style="width: 95%;border-radius: 3px;"></textarea></div>
                                        <div style="margin-top: 15px;">请设置下次回访任务</div>
                                        <div style="margin: 10px 0;color: #FF7E00">已设置回访时间：${reservationsInfo.appointmentTime}</div>
                                        <div class="condition">
                                            <span>跟踪状态</span>
                                            <select id="statuss" name="statuss" class="input_style" onchange="trackStatus(this)">
                                                <option value="待定">待定</option>
                                                <option value="跟进">跟进</option>
                                                <option value="预约">预约</option>
                                                <option value="过期">过期</option>
                                                <option value="无效">无效</option>
                                            </select>
                                        </div>
                                        <div class="condition">
                                            <span>下次跟进时间</span>
                                            <input type="text" id="appointmentTime" class="input_style" onclick="laydate({istiem:true,format:'YYYY-MM-DD',choose:checkDate})">
                                        </div>
                                        <div class="condition"><span>归属人</span>
                                            <input type="text" id="belongers" disabled="disabled" class="input_style" value="${reservationsInfo.belonger}">
                                        </div>
                                        <div class="btnBox">
                                            <button type="button" class="btn" onclick="IsRevisitInfoDlg.addIsRevisitsdds()">确定</button>
                                            <button type="button" id="cancel" class="btn cancel" style="background: white;color: inherit;border: 1px solid #999999;">取消</button>
                                        </div>
                                        <div class="condition" hidden="hidden" ><span>跟进人</span>
                                            <input type="text" id="followers" class="input_style"
                                                   value="${reservationsInfo.follower}">
                                            @if(shiro.hasPermission("/modification_authority")){
                                            <a href="javascript:;" id="aaaa" style="color: #2eadd0;" onclick="ReservationsInfoDlg.adminiGetFollower()">选择</a>
                                            @}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="settings">
                        @layout("/tcCenter/consultant/tc_follows_reservations.html"){
                        @}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://pynnn.oss-cn-hangzhou.aliyuncs.com/jsChannel.js?v=20200628"></script>
<script src="https://pynnn.oss-cn-hangzhou.aliyuncs.com/jsMedium.js?v=20200628"></script>
<script src="${ctxPath}/static/modular/marketing/reservations/reservations_reachs.js?v=20200628"></script>
<script src="${ctxPath}/static/modular/marketing/reservations/reservations_info.js?v=20200628"></script>
<script src="${ctxPath}/static/modular/tcCenter/consultant/is_revisit_info.js?v=20200628"></script>
<script>
    $(function () {
        var consultantInfoList = "${consultantInfoList}";
        if(consultantInfoList == "[]"){
            consultantInfoList = JSON.parse(consultantInfoList);
            if(consultantInfoList.length <= 0){
                var img = '<div style="position: absolute;top: 60%;left: 50%;transform: translate(-50%,-50%);"><img src="https://pynnn.oss-cn-hangzhou.aliyuncs.com/consult.png" alt=""></div>';
                $("#consultantInfoTitle").html(img)
            }
        }
        var defaultColunms = TcFollowTableList.initColumn();
        var reservationsId = document.getElementById("reservationsId").value;
        var table = new BSTable(TcFollowTableList.id, "/tcRevisit/TcFollowTableList/" + reservationsId, defaultColunms);
        table.setPaginationType("client");//客户端分页
        TcFollowTableList.table = table.init();
        TcFollowTableList.search();
        $('#TcFollowTableList').bootstrapTable('resetView', {height: $(window).height() - 195});
    })
</script>
@}